package com.easou.ps.dk.domain;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class BaiduResult {

	private List<ABaiduResult> results;

	public ABaiduResult getABaidu(String query){
		for (int i = 0; i < results.size(); i++) {
			if(results.get(i).getQuery().equals(query)){
				return results.get(i);
			}
		}
		return null;
	}
	
	public void putABaidu(String query,String url){
		if(results == null){
			results = new ArrayList<ABaiduResult>();
		}
		for (int i = 0; i < results.size(); i++) {
			if(results.get(i).getQuery().equals(query)){
				results.get(i).putUrl(url);
				return ;
			}
		}
		ABaiduResult aBaiduResult = new ABaiduResult();
		aBaiduResult.setQuery(query);
		aBaiduResult.putUrl(url);
		results.add(aBaiduResult);
	}
	
	public List<ABaiduResult> getResults() {
		return results;
	}

	public void setResults(List<ABaiduResult> results) {
		this.results = results;
	}


}